package com.myTimeUtils.android.TimeTracker.System;
import com.myTimeUtils.android.TimeTracker.Global.Observer;
import java.util.ArrayList;
/**
 * Defines the system independent portion of the timer.
 *
 * @author Joseph Walker
 */
public abstract class Timer{
	private ArrayList<Observer> observers;
	/**
	 * Constructs a timer object.
	 */
	public Timer(){
		this.observers = new ArrayList<Observer>();
	}
	/**
	 * Alerts the observers of this timer.
	 */
	public void alertObservers(){
		for(Observer o: observers) o.notifyObserver();
	}
	/**
	 * Adds the observer to the list of observers.
	 *
	 * @param observer		The observer to watch
	 */
	public void registerObserver(Observer observer){
		this.observers.add(observer);
	}
	/**
	 * Defines the way in which this timer will count.
	 */
	public abstract void run();
}
